<template>
  <el-form-item :rules="item.rule" :label="item.label" :prop="item.prop">
    <el-checkbox-group
      v-model="formData[item.prop]"
      @change="item.change && item.change(formData[item.prop])"
      :disabled="item.disabled"
    >
      <el-checkbox
        v-for="child in item.children"
        :label="child.code"
        :key="child.code"
        border
      >
        {{ child.label }}
      </el-checkbox>
    </el-checkbox-group>
  </el-form-item>
</template>

<script>
export default {
  name: "checkboxButtonCom",
  props: {
    item: {
      type: Object,
      default: () => {
        return {};
      }
    },
    formData: {
      type: Object,
      default: () => {
        return {};
      }
    }
  }
};
</script>

<style scoped lang="scss"></style>
